/*
    manifest.me - MakeMe Manifest for Pak
 */

Me.load({
    /*
        Package manifest instructions

        The sets used are: binary, service, test, doc, dev, package, source
     */
    manifest: {
        home: me.dir.bin,
        root: false,
        packages:   {
            install: {
                inherit:    'package-manifest',
                prefixes:   [ 'root', 'app', 'vapp', 'bin', 'man'],
                sets:       [ 'core', 'libs', 'doc' ],
                platforms:  [ 'windows', 'unix' ]
            },
            binary: {
                inherit:    'package-manifest',
                prefixes:   [ 'root', 'app', 'vapp', 'bin', 'man'],
                formats:    [ 'native', 'tar' ],
                sets:       [ 'core', 'libs', 'doc', 'package' ],
                platforms:  [ 'freebsd', 'linux', 'windows', 'macosx' ]
            },
            source: {
                inherit:    'package-manifest',
                prefixes:   [ 'root', 'src'],
                formats:    [ 'tar' ],
                sets:       [ 'source' ],
            },
        },

        sets: { 
            core: [
                {   
                    from:       'pak${EXE}',
                    to:         '${abin}/',
                    symlink:    '${bin}/',
                    permissions: 0755,

                }, { 
                    from: [
                                '${BIN}/roots.crt',
                                'ejs.mod',
                                'pak.mod',
                    ],
                    to:     '${abin}/',
                }
            ],
            libs: [
                { 
                    from: [
                                'libejs${SHOBJ}',
                                'libhttp${SHOBJ}',
                                'libmpr${SHOBJ}',
                                'libpcre${SHOBJ}',
                                'libzlib${SHOBJ}',
                    ],
                    to:         '${abin}/',
                    enable:     '!me.settings.static',
                }
            ],
            doc: [
                { 
                    from:       '${TOP}/doc/dist/man/pak.1',
                    to:         '${adoc}/man/man1/',
                    symlink:    '${man}/man1/',
                    enable:     "me.platform.like == 'unix'",
                }
            ],
            source: [
                { 
                    from:       '${TOP}/*.md',
                    to:         '${src}/',
                    fold:       true,
                    patch:      true,

                }, { 
                    from:       '${TOP}/configure',
                    to:         '${src}/',
                    permissions: 0755,     

                }, { 
                    home:       '${TOP}',
                    from: [ 
                                'Makefile', 
                                'make.bat', 
                                'main.me', 
                                'package.json', 
                                'paks', 
                                'src', 
                                'doc', 
                                'projects', 
                                'installs' 
                    ],
                    exclude:    /\.old$|\.tmp$|xcuserdata|xcworkspace|project.guid|-mine/,
                    to:         '${src}/',
                    flatten:    false,
                }
            ]
        }
    }
})
